Linear time computation of the maximal linear and circular sums of multiple independent insertions into a sequence
نویسندگان
چکیده
The maximal sum of a sequence A of n real numbers is the greatest sum of all elements of any linearly contiguous and possibly empty subsequence of A. It can be computed in O(n) time by means of Kadane’s algorithm. Letting A denote the sequence which results from inserting a real number x between elements A[p− 1] and A[p], we show how the maximal sum of A can be computed in O(1) worst-case time for any given x and p, provided that an O(n) time preprocessing step has already been executed on A. In particular, this implies that, given m pairs (x0, p0), . . . , (xm−1, pm−1), we can compute the maximal sums of sequences A00, . . . , Am−1m−1 optimally in O(n+m) time, improving on the straightforward and suboptimal strategy of applying Kadane’s algorithm to each sequence Aii, which takes a total of Θ(n · m) time. Our main contribution, however, is to obtain the same time bound for the more complicated problem of computing the greatest sum of all elements of any linearly or circularly contiguous and possibly empty subsequence of A. Our algorithms are easy to implement in practice, and they were motivated by and find application in a buffer minimization problem on wireless mesh networks.
منابع مشابه
The Almost Sure Convergence for Weighted Sums of Linear Negatively Dependent Random Variables
In this paper, we generalize a theorem of Shao [12] by assuming that is a sequence of linear negatively dependent random variables. Also, we extend some theorems of Chao [6] and Thrum [14]. It is shown by an elementary method that for linear negatively dependent identically random variables with finite -th absolute moment the weighted sums converge to zero as where and is an array of...
متن کاملComplete Convergence and Some Maximal Inequalities for Weighted Sums of Random Variables
Let be a sequence of arbitrary random variables with and , for every and be an array of real numbers. We will obtain two maximal inequalities for partial sums and weighted sums of random variables and also, we will prove complete convergence for weighted sums , under some conditions on and sequence .
متن کاملA scalarization-based method for multiple part-type scheduling of two-machine robotic systems with non-destructive testing technologies
This paper analyzes the performance of a robotic system with two machines in which machines are configured in a circular layout and produce non-identical parts repetitively. The non-destructive testing (NDT) is performed by a stationary robotic arm located in the center of the circle, or a cluster tool. The robotic arm integrates multiple tasks, mainly the NDT of the part and its transition bet...
متن کاملNonlocal Elasticity Effect on Linear Vibration of Nano-circular Plate Using Adomian Decomposition Method
In this study, the small scale effect on the linear free-field vibration of a nano-circular plate has been investigated using nonlocal elasticity theory. The formulation is based on the classical theory and the linear strain in cylindrical coordinates. To take into account the small scale and the linear geometric effects, the governing differential equation based on the nonlocal elasticity theo...
متن کاملOPTIMUM GENERALIZED COMPOUND LINEAR PLAN FOR MULTIPLE-STEP STEP-STRESS ACCELERATED LIFE TESTS
In this paper, we consider an i.e., multiple step-stress accelerated life testing (ALT) experiment with unequal duration of time . It is assumed that the time to failure of a product follows Rayleigh distribution with a log-linear relationship between stress and lifetime and also we assume a generalized Khamis-Higgins model for the effect of changing stress levels. Taking into account that the...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Theor. Comput. Sci.
دوره 661 شماره
صفحات -
تاریخ انتشار 2017